Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Ed25519 #18

Merged
merged 3 commits into from
Jun 29, 2023
Merged

Add support for Ed25519 #18

merged 3 commits into from
Jun 29, 2023

Conversation

mwander
Copy link

@mwander mwander commented May 12, 2023

This PR adds support for Ed25519 (closes #9).
Depends on Crypt::PK::Ed25519. Added test cases for signing and verification.

Most code has been added to PrivateKey.pm and PublicKey.pm. The ed25519_sha256.pm subclass is basically identical to rsa_sha256pm. I tried to retain existing logic wherever possible, but it was necessary to branch between 'rsa' and 'ed25519' code in serveral locations. Please review carefully.

@marcbradshaw marcbradshaw self-assigned this May 17, 2023
@marcbradshaw
Copy link
Member

@mwander Thanks for this, I have refactored a few places to make the flow clearer, but looks good.

Note: some consumers of this module may assume a RSA key object is returned by $signature->get_public_key(), and the new key type differs. For example, when querying the key size the class for Ed25519 keys doesn't have a size method, which can result in confusing results, or worst case a runtime error.

dkim=pass (0-bit  key sha256) header.d=wander.science
  header.i=@wander.science header.b=85mI8hH/ header.a=-sha256
  header.s=2023-05-ed25519 x-bits=0;

This is something folks will need to consider when upgrading to this version.

@marcbradshaw marcbradshaw merged commit d146356 into fastmail:master Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EdDSA (ed25519) support
2 participants